package UnitTest;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * @Auther: Administrator
 * @Date: 2019/9/10/010 19 49
 * @Description:
 */
public class CalDaysNum {
    public static void main(String[] args) {
        int i = calDaysNum("2019-01-02");
        System.out.println(i);

    }

    public static int calDaysNum(String time){
        DateTimeFormatter dateTimeFormatter= DateTimeFormatter.ofPattern("yyyy-MM-dd");
        LocalDate localDate = LocalDate.parse(time, dateTimeFormatter);
        return localDate.getDayOfYear();
    }

}
